<?php
include "db.conf.php";
$sTableName="2014_w_la";
$sTeamworkName="tw_1";

$sqlConnect = new mysqli($sServer,$sUser,$sPassword,$sDatabaseName);

foreach ($_REQUEST as $sStudentID => $nPeerEval)
{
	$sQuery = "UPDATE `".$sTableName."` SET `".$sTeamworkName."`=".$nPeerEval." WHERE `student_number`=".$sStudentID;
	$sqlResult=$sqlConnect->query($sQuery);
	
	$nAffectedRows=$sqlConnect->affected_rows;

	if ($nAffectedRows>0)
	{
		echo "update ".$sStudentID." to ".$nPeerEval.": done<br/>";
	}
}
$sqlConnect->close();
echo "Update Done";
?>
